home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-26 | 3.9 KB | 168 lines | [TEXT/MPS ] |
- //==========================================================
- //
- // File: BeeperSel.cpp
- // Release Version: $ 1.0d9 $
- //
- // Author: M.Boetcher
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //==========================================================
-
- #ifndef BEEPERSEL_H
- #include "BeeperSel.h"
- #endif
-
- #ifndef BEEPERPART_H
- #include "BeeperPart.h"
- #endif
-
- #ifndef BEEPERDEF_H
- #include "BeeperDef.h"
- #endif
-
- #ifndef ACTIONS_H
- #include "Actions.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWBARRAY_H
- #include "FWBArray.h"
- #endif
-
- #ifndef FWMEMMGR_H
- #include "FWMemMgr.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__DRAG__)
- #include <Drag.h>
- #endif
-
- //==========================================================
- // Runtime information
- //==========================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment BeeperPart
- #endif
-
- //==========================================================
- // CLASS CBeeperSelection
- //==========================================================
-
- //----------------------------------------------------------
- // CBeeperSelection constructor
- //----------------------------------------------------------
-
- CBeeperSelection::CBeeperSelection(Environment* ev,
- CBeeperPart* beeperPart) :
- FW_CSelection(ev, FALSE, FALSE),
- fBeeperPart(beeperPart)
- {
- }
-
- //----------------------------------------------------------
- // CBeeperSelection destructor
- //----------------------------------------------------------
-
- CBeeperSelection::~CBeeperSelection()
- {
- }
-
- //----------------------------------------------------------
- // CBeeperSelection::CloseSelection
- //----------------------------------------------------------
-
- void CBeeperSelection::CloseSelection(Environment* ev)
- {
- // Nothing to do
- }
-
- //----------------------------------------------------------
- // CBeeperSelection::ClearSelection
- //----------------------------------------------------------
-
- FW_Boolean CBeeperSelection::ClearSelection(Environment* ev,
- FW_ClearSelection clearAfter)
- {
- return FALSE; // Do nothing
- }
-
- //----------------------------------------------------------
- // CBeeperSelection::IsEmpty
- //----------------------------------------------------------
-
- FW_Boolean CBeeperSelection::IsEmpty(Environment* ev) const
- {
- return (fBeeperPart->GetAction() == NULL);
- }
-
- //----------------------------------------------------------
- // CBeeperSelection::SelectAll
- //----------------------------------------------------------
-
- void CBeeperSelection::SelectAll(Environment* ev)
- {
- // Nothing to do
- }
-
- //----------------------------------------------------------
- // CBeeperSelection::DoExternalizeSelection
- //----------------------------------------------------------
-
- void CBeeperSelection::DoExternalizeSelection(
- Environment* ev,
- ODStorageUnit* storage,
- FW_CCloneInfo* cloneInfo)
- {
- CAction *action = fBeeperPart->GetAction();
- if (action)
- {
- storage->AddProperty(ev, kODPropContents);
- action->Externalize(ev, storage);
- }
- }
-
- //----------------------------------------------------------
- // CBeeperSelection::DoInternalizeSelection
- //----------------------------------------------------------
-
- FW_Boolean CBeeperSelection::DoInternalizeSelection(
- Environment* ev,
- ODStorageUnit* storage,
- FW_CCloneInfo* cloneInfo)
- {
- FW_Boolean internalized = FALSE;
-
- CAction *action = NULL;
- if (CScriptAction::IsInStorage(ev, storage))
- action = new CScriptAction();
- else if (CSoundAction::IsInStorage(ev, storage))
- action = new CSoundAction();
-
- if (action != NULL)
- {
- action->Internalize(ev, storage);
- fBeeperPart->SetAction(action);
- fBeeperPart->Changed(ev);
- internalized = true;
- }
-
- return internalized;
- }
-